import Vue from "vue"
import VueRouter from "vue-router"
import Foo from './components/Foo';
import Bar from './components/Bar';
import User from './components/User';

Vue.use(VueRouter)

export default new VueRouter({
    routes: [
        { path: '/foo', component: Foo,name:'Foo'},
        { path: '/bar', component: Bar ,name:'Bar'},
        // { path: '/user/:ele', component: User ,name:'User'},
        { path: '/user', component: User ,name:'User',
            children:[
                {path:'foo',component:Foo},
                {path:'bar',component:Bar},
                {path:':sec',component:Bar},
            ]
        },
        {path:'/abc',components:{
            a:Foo,
            b:Bar
        }}
    ]
})